<html>
<head><meta charset="utf-8"><title>mir::Body impls Copy? · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/mir.3A.3ABody.20impls.20Copy.3F.html">mir::Body impls Copy?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="179092095"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/mir%3A%3ABody%20impls%20Copy%3F/near/179092095" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/mir.3A.3ABody.20impls.20Copy.3F.html#179092095">(Oct 25 2019 at 21:50)</a>:</h4>
<p>What makes <code>mir::Body</code> impl <code>ArenaAllocatable</code>? I can see that in <code>librustc/query/mod.rs</code> (<a href="https://github.com/rust-lang/rust/blob/master/src/librustc/query/mod.rs#L128" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc/query/mod.rs#L128">https://github.com/rust-lang/rust/blob/master/src/librustc/query/mod.rs#L128</a>) that it's passed to <code>fn alloc</code> of  <a href="https://github.com/rust-lang/rust/blob/master/src/librustc/arena.rs#L201" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc/arena.rs#L201">https://github.com/rust-lang/rust/blob/master/src/librustc/arena.rs#L201</a> , but I can only find <code>impl &lt;T: Copy&gt; ArenaAllocatable for T {}</code>, and <code>Body</code> isn't <code>Copy</code>. So where's the plumbing that makes this work???</p>



<a name="179092146"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/mir%3A%3ABody%20impls%20Copy%3F/near/179092146" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/mir.3A.3ABody.20impls.20Copy.3F.html#179092146">(Oct 25 2019 at 21:51)</a>:</h4>
<p><span class="user-mention" data-user-id="116114">@Paul Faria</span> <a href="https://github.com/Mark-Simulacrum/rust/blob/1ab8dc8e119fa7f963c0dcee29574e694ed9d08d/src/librustc/arena.rs#L27" target="_blank" title="https://github.com/Mark-Simulacrum/rust/blob/1ab8dc8e119fa7f963c0dcee29574e694ed9d08d/src/librustc/arena.rs#L27">https://github.com/Mark-Simulacrum/rust/blob/1ab8dc8e119fa7f963c0dcee29574e694ed9d08d/src/librustc/arena.rs#L27</a> is I suspect the answer to your question</p>



<a name="179094494"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/mir%3A%3ABody%20impls%20Copy%3F/near/179094494" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/mir.3A.3ABody.20impls.20Copy.3F.html#179094494">(Oct 25 2019 at 22:27)</a>:</h4>
<p>That's exactly it. Thank you!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>